# 方法1
for row in range(1,10):
    for col in range(1,row+1):
        print('{}*{}={:<4}'.format(row,col,row*col),end=' ')
    print('')

print('')
print('='*60)
# --------------------------------------------------------
i = 1
while i < 10:
    j = 1
    while j < i+1:
        print('%d*%d=%2d' %(i ,j ,i*j) ,end = ' ')
        j += 1
    i += 1
    print(' ')
print('')
print('='*60)

# ========================================================
# 方法2
i = 9
while i >= 1:

    j = 1
    while j <= i:
        print("%d*%d=%2d " % (j, i, i * j), end='')
        j += 1
    print()
    i -= 1
print('')
print('='*60)

# --------------------------------------------------------

for row in range(9,0,-1):
    for col in range(1,row+1):
        print('{}*{}={:<4}'.format(col,row,row*col),end=' ')
    print('')

print('')
print('='*60)

# ========================================================